<!DOCTYPE html>
<html>
#{include file="header.html"}#
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
  <div class="row">
    <div class="col-sm-12">
      <div class="ibox float-e-margins">
        <div class="ibox-title">
          <h5><i class="fa fa-home"></i>短信记录</h5>
        </div>
        <div class="ibox-content">
          <form id="pagerForm" method="post"  class="form-inline">
            <div class="row">
              <div class="col-sm-3 m-b-xs">
				  		<a class="btn btn-info" href="#">导出数据</a>
				  		<a class="btn btn-danger batch_operation" data-act="del" href="javascript:void(0);" >批量删除</a>
              </div>
              <div class="col-sm-9 m-b-xs text-right" id="date_1"> 发送时间：
                <div class="input-daterange input-group" id="datepicker1">
                  <input type="text" class="input-sm form-control" name="sdt1" placeholder="选择开始时间"/>
                  <span class="input-group-addon">到</span>
                  <input type="text" class="input-sm form-control" name="edt1" placeholder="选择结束时间" />
                </div>
                <div class="btn-group">
                  <button data-toggle="dropdown" class="btn  dropdown-toggle"><span class="caret"></span></button>
                  <div class="dropdown-menu">
                    <div class="ibox-content">
                      <div class="form-group">
                        <label>手机号</label>
                        <input type="text" name="emailaddress" placeholder="邮箱地址" class="form-control">
                      </div>
                      <div class="form-group">
                        <label>内容</label>
                        <input type="text" name="content" placeholder="发送内容" class="form-control">
                      </div>
                      <div class="form-group">
                        <button type="button" class="btn btn-primary btn-xs btn-block ajaxSearchForm"><i class="fa fa-search"></i> 搜索</button>
                      </div>
                    </div>
                  </div>
                </div>
                <div class="input-group"> 
							<span class="">
                  <button type="button" class="btn btn-primary ajaxSearchForm"><i class="fa fa-search"></i> 搜索</button>
                  </span> </div>
              </div>
            </div>
          </form>
          <table class="table table-hover  sorttable 07fly-table">
            <thead>
              <tr>
                <th width="22"><input type="checkbox" group="ids" class="checkboxCtrl"></th>
                <th width="150" align="center">送达地址</th>
                <th width="150" align="center">发送时间</th>
                <th>详细内容</th>
              </tr>
            </thead>
            <tbody>
            
            #{foreach from=$list key=k item=v}#
            <tr target="sid_user" rel="#{$v.id}#">
              <td><input name="ids" value="#{$v.id}#" type="checkbox"></td>
              <td align="left">#{$v.emailaddress}#</td>
              <td align="left">#{$v.adddatetime}#</td>
              <td align="left">#{$v.content}#</td>
            </tr>
            #{/foreach}#
              </tbody>    
            <tfoot class="ibox-content">
              <tr>
                <td colspan="4" align="center"></td>
              </tr>
            </tfoot>
          </table>
        </div>
      </div>
    </div>
  </div>
</div>
</body>
</html>
<script id="tableListTpl" type="text/html">
<% for(var i=0;i<list.length;i++) { %>
	<tr>
		<td><input name="ids" class="checkboxCtrlId" value="<%=list[i]['id']%>" type="checkbox"></td>
		<td><%=list[i]['emailaddress']%></td>
		<td><%=list[i]['adt']%></td>
		<td><%=list[i]['content']%></td>
	</tr>
<% } %>
</script>
<!-- 自定义js -->
<script src="#{$smarty.const.APP}#/View/template/js/content.js?v=1.0.0"></script>
<script>
var ajaxUrl='#{$smarty.const.ACT}#/sysmanage/EmailLog/email_log_json/';
$(document).ready(function () {
	turnPage(1);//页面加载时初始化分页

		$("body").on("click", ".batch_operation", function() {
		batch_act =$(this).attr("data-act")
		var chk_value =[]; 
    	$("tbody input[class='checkboxCtrlId']:checked").each(function(){ 
        chk_value.push($(this).val()); 
		}); 
		id_txt=chk_value.join(",");
		if(batch_act=="del"){
			act_url="#{$smarty.const.ACT}#/sysmanage/EmailLog/email_log_del/";
		}
		//alert(id_txt);
    //alert(chk_value.length==0 ?'你还没有选择任何内容！':chk_value); 
		$.ajax({
			type: "POST",
			url: act_url,
			data:{"ids":id_txt},
			dataType:"json",
			success: function(data){
				if(data.rtnstatus=='success'){
					layer.msg('操作成功', {icon: 1});
					turnPage(1);
				}
			},
			complete: function () {//完成响应
			}
		});
	});

});
</script>
</script>